From c82f15201a51d6ff802139839cffea1a158ec0f9 Mon Sep 17 00:00:00 2001 From: Mathnerd314 Date: Mon, 23 May 2016 12:52:56 -0600 Subject: [PATCH] log: Display "(no subject)" for commits without a subject This resolves the ambiguity for a message with a body but no subject, and also hints that OSTree is using two bytes to store the empty commit subject/body (when instead they could be stored, or rather, not stored, as part of the metadata) Closes: #305 Approved by: cgwalters --- src/ostree/ot-dump.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ostree/ot-dump.c b/src/ostree/ot-dump.c index 670ccd6a..48b087af 100644 --- a/src/ostree/ot-dump.c +++ b/src/ostree/ot-dump.c @@ -118,8 +118,15 @@ dump_commit (GVariant *variant, g_print ("Version: %s\n", version); } - g_print ("\n"); - dump_indented_lines (subject); + if (subject[0]) + { + g_print ("\n"); + dump_indented_lines (subject); + } + else + { + g_print ("(no subject)\n"); + } if (body[0]) { -- 2.30.2